package com.xlinur.moviegrabber;

import java.util.Collections;
import java.util.HashMap;

public class GrabberKinopoisk extends Grabber {

	@SuppressWarnings("serial")
	GrabberKinopoisk() {
		mUriSearch = "http://m.kinopoisk.ru/search/{1}/";
		mUriItem = "http://m.kinopoisk.ru/movie/{1}/";
		mEncoding = "CP-1251";
		mPrefix = "kinopoisk.ru:";
		mXpathListItem = "/body/div[@id='page']/div[@id='content']/div[@class='block search'][position() < 3]/span[position() < 6]/a";
		mXpathItem = Collections.unmodifiableMap(new HashMap<String, String>(
				10, 1.0f) {
			{
				put("title",
						"/body/div[@id='page']/div[@id='content']/p[@class='title']/b[1]");
				put("!original_title,year,length!~,!!! мин.",
						"/body/div[@id='page']/div[@id='content']/p[@class='title']/span[1]");
				put("genre",
						"/body/div[@id='page']/div[@id='content']/div[@class='block film']/span[1]");
				put("country",
						"/body/div[@id='page']/div[@id='content']/div[@class='block film']/span[2]");
				put("director",
						"/body/div[@id='page']/div[@id='content']/div[@class='block film']/span[@class='clear'][1]/a");
				put("actors",
						"/body/div[@id='page']/div[@id='content']/div[@class='block film']/span[@class='clear'][2]/a");
				put("description",
						"/body/div[@id='page']/div[@id='content']/div[@class='block film']/p[@class='descr']");
				put("ext_rate",
						"/body/div[@id='page']/div[@id='content']/div[@class='block film']/span[5]/i[1]");
			}
		});
	}
}